-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't remove spaces when printing a new bottom line with a background color #5550
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand why we're hitting the "optimize spaces" case between two other characters.
Also, do you think it would be possible to save the whole TextAttribute and use the HasIdenticalVisualRepresentationForBlankSpace
function? It takes care of cases like global and local inverse (which James pointed out) which I think could be a ... problem .. here
nevermind, it won't be a problem here because we're using the COLORREFs and we've lost text attribute info by this point (#2661)
Caching more state always scares me :)
So in this case, the row we're printing is separated into two runs:
It's that first run's 9 spaces that we tried to optimize with the ECH. I could certainly see us needing to cache more info, but maybe that's just something we should handle in #2661 when we have all the info in one nice blob |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love it, but it works and that's more important than ideology.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This spaghetti is killing me, but if it works, I have to agree with Dustin and just let it go. At least there are more tests than we had two months ago before this started so we might have some hope of making this less gross in the future.
Hello @DHowett-MSFT! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
…ackground-colors-after-circling
Wow -- merging master actually broke the test (???) Sorry :( |
🎉 Handy links: |
Turns out we're still being a bit too aggressive when removing spaces.
If there are spaces at the end of the first run painted to a bottom
line, and the bottom line was a different color than the previous,
then we can't trim those spaces off the string. We still need to emit
those to make sure the terminal has colored spaces in it as well.
References
PR Checklist
Validation Steps